package com.spn.blog.common.vo;


import lombok.AllArgsConstructor;
import lombok.Data;

import java.io.Serializable;

@Data
@AllArgsConstructor
// "返回统一参数Result")
public class Result implements Serializable {

    // "成功"
    private boolean success;

    // "200：成功"
    private int code;

    // "返回信息说明"
    private String msg;

    // "返回内容"
    private Object data;


    public static Result success(Object data){
        return new Result(true, 200, "success", data);
    }

    public static Result fail(int code, String msg){
        return new Result(false,code,msg,null);
    }
}
